347eade8b030bbbf6fa194e8745d943180c3ba0d,xwiki-platform-watchlist/plugin/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListStore.java,WatchListStore,removeWatchedElement,#String#String#ElementType#XWikiContext#,427

Before Change


        }

        List<String> watchedElements = new ArrayList<String>();
        watchedElements.addAll(getWatchedElements(user, type, context));
        watchedElements.remove(elementToRemove);

        this.setWatchListElementsProperty(user, type, watchedElements, context);

After Change


    {
        String elementToRemove = watchedElement;
        
        if (!ElementType.WIKI.equals(type) && !watchedElement.contains(WIKI_SPACE_SEP)) {
            elementToRemove = context.getDatabase() + WIKI_SPACE_SEP + watchedElement;
        }

        if (!this.isWatched(elementToRemove, user, type, context)) {
            return false;
        }
        
        List<String> watchedElements = getWatchedElements(user, type, context);
        watchedElements.remove(elementToRemove);

        this.setWatchListElementsProperty(user, type, watchedElements, context);